<template>
	<view>
		汇总记录：<br />
		<textarea v-model="oldData" maxlength="100000">

		</textarea>
		处理后:<br />
		<textarea v-model="newData" maxlength="100000">

		</textarea>
		<button @click="dealBY">
			处理保养
		</button><br/>
		<button @click="dealDJ">
			处理点检
		</button><br/>
		<button @click="dealWX">
			处理维修
		</button><br/>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				oldData: '',
				newData: '',
				baoyangItem: [
					'编带',
					'封端烧端',
					'沉积线离心机钢珠分选机',
					'DF_外观测试(片感)',
					'丝印',
					'砂磨流延切膜',
					'打孔',
					'叠压',
					'黄光',
					'烧炉组',
					'成型组',
					'赛美特',
					'D1_配料(片感)',
					'D2_流延(片感)',
					'D3_丝印(片1',
					'D4_层压(片感)',
					'D5_切割(片感)',
					'D6_装钵(片感)',
					'D7_排胶(片感)',
					'D8_烧成(片感)',
					'D9_倒角(片感)',
					'DA_封端(片感)',
					'DB_烧银(片感)',
					'沉积',
					'DI_编带(片感)',
					'DK_烘巴(片感)',
					'DM_回炉(片感)',
					'DP_制网(片感)',
					'DS_镀前测试(片感)',
					'DV_干法成型',
					'DW_干法丝印',
					'DX_干法打孔',
					'DY_一次封端（片感）',
					'DZ_一次烧银',
					'GH_固化',
					'M1_冷压',
					'M2_绕线',
					'M3_三面检外观',
					'M4_热压',
					'M5_滚喷',
					'M6_剥漆',
					'M7_六面检外观',
					'M8_测包',
					'M9_检带',
					'MA_电镀',
					'OE_喷涂',
					'oF_烧玻璃',
					'oI_敏化',
					'OP_外购',
					'Qm_干法切膜',
					'R0_绕线',
					'R1_绕线',
					'R1_注胶',
					'R2_印标',
					'R3_测试、编带',
					'R4_成品检',
					'R6_入库',
					'R7_检外观',
					'RH_组装',
					'SM_干法砂磨'
				], //保养基础列数据
				dianjianItem: [
					'编带',
					'封端烧端',
					'沉积线离心机钢珠分选机',
					'DF_外观测试(片感)',
					'丝印',
					'砂磨流延切膜',
					'打孔',
					'叠压',
					'黄光',
					'烧炉组',
					'成型组',
					'赛美特',
					'D1_配料(片感)',
					'D2_流延(片感)',
					'D3_丝印(片1',
					'D4_层压(片感)',
					'D5_切割(片感)',
					'D6_装钵(片感)',
					'D7_排胶(片感)',
					'D8_烧成(片感)',
					'D9_倒角(片感)',
					'DA_封端(片感)',
					'DB_烧银(片感)',
					'沉积',
					'DI_编带(片感)',
					'DK_烘巴(片感)',
					'DM_回炉(片感)',
					'DP_制网(片感)',
					'DS_镀前测试(片感)',
					'DV_干法成型',
					'DW_干法丝印',
					'DX_干法打孔',
					'DY_一次封端（片感）',
					'DZ_一次烧银',
					'GH_固化',
					'M1_冷压',
					'M2_绕线',
					'M3_三面检外观',
					'M4_热压',
					'M5_滚喷',
					'M6_剥漆',
					'M7_六面检外观',
					'M8_测包',
					'M9_检带',
					'MA_电镀',
					'OE_喷涂',
					'oF_烧玻璃',
					'oI_敏化',
					'OP_外购',
					'Qm_干法切膜',
					'R0_绕线',
					'R1_绕线',
					'R1_注胶',
					'R2_印标',
					'R3_测试、编带',
					'R4_成品检',
					'R6_入库',
					'R7_检外观',
					'RH_组装',
					'SM_干法砂磨',
					'品管'
				], //点检基础列数据
				weixiuItem: [
					'编带',
					'封端烧端',
					'沉积线离心机钢珠分选机',
					'DF_外观测试(片感)',
					'丝印',
					'砂磨流延切膜',
					'打孔',
					'叠压',
					'黄光',
					'烧炉组',
					'成型组',
					'赛美特',
					'D1_配料(片感)',
					'D2_流延(片感)',
					'D3_丝印(片1',
					'D4_层压(片感)',
					'D5_切割(片感)',
					'D6_装钵(片感)',
					'D7_排胶(片感)',
					'D8_烧成(片感)',
					'D9_倒角(片感)',
					'DA_封端(片感)',
					'DB_烧银(片感)',
					'沉积',
					'DI_编带(片感)',
					'DK_烘巴(片感)',
					'DM_回炉(片感)',
					'DP_制网(片感)',
					'DS_镀前测试(片感)',
					'DV_干法成型',
					'DW_干法丝印',
					'DX_干法打孔',
					'DY_一次封端（片感）',
					'DZ_一次烧银',
					'GH_固化',
					'M1_冷压',
					'M2_绕线',
					'M3_三面检外观',
					'M4_热压',
					'M5_滚喷',
					'M6_剥漆',
					'M7_六面检外观',
					'M8_测包',
					'M9_检带',
					'MA_电镀',
					'OE_喷涂',
					'oF_烧玻璃',
					'oI_敏化',
					'OP_外购',
					'Qm_干法切膜',
					'R0_绕线',
					'R1_绕线',
					'R1_注胶',
					'R2_印标',
					'R3_测试、编带',
					'R4_成品检',
					'R6_入库',
					'R7_检外观',
					'RH_组装',
					'SM_干法砂磨'
				] //维修基础列数据
			}
		},
		onLoad() {

		},
		created() {

		},
		computed: {

		},
		methods: {
			//是否包含对象
			containItem(Arr,name){
				var reItem=null;
				for (var i = 0; i < Arr.length; i++) {
					var lineItem  = Arr[i];
					var Arr1=lineItem.split('\t');
					if (Arr1[0]==name) {
						reItem=Arr1;
						break;
					}
				
				}
				return reItem;
			},
			dealBY(){
				var copyDic={};
				this.newData='';
				var Arr1 = this.oldData.split('\n');
				for (var i = 0; i < this.baoyangItem.length; i++) {
					var it=this.baoyangItem[i];
					var nameItem=this.containItem(Arr1,it);
					// console.log(nameItem);
					if(nameItem!=null){
						copyDic[it]=nameItem[1];
						this.newData+=nameItem[1]+'\n';
						console.log(it,nameItem[1]);
					}else{
						copyDic[it]={it:' '};
						this.newData+=' \n';
						console.log(it,' ');
					}
				}
				console.log('保养\n',copyDic);
			},
			dealDJ(){
				var copyDic={};
				this.newData='';
				var Arr1 = this.oldData.split('\n');
				for (var i = 0; i < this.dianjianItem.length; i++) {
					var it=this.dianjianItem[i];
					var nameItem=this.containItem(Arr1,it);
					// console.log(nameItem);
					if(nameItem!=null){
						copyDic[it]=nameItem[1];
						this.newData+=nameItem[1]+'\n';
						console.log(it,nameItem[1]);
					}else{
						copyDic[it]={it:' '};
						this.newData+=' \n';
						console.log(it,' ');
					}
				}
				console.log('点检\n',copyDic);
			},
			dealWX(){
				var copyDic={};
				this.newData='';
				var Arr1 = this.oldData.split('\n');
				for (var i = 0; i < this.weixiuItem.length; i++) {
					var it=this.weixiuItem[i];
					var nameItem=this.containItem(Arr1,it);
					// console.log(nameItem);
					if(nameItem!=null){
						copyDic[it]=nameItem[1];
						this.newData+=nameItem[1]+'\n';
						console.log(it,nameItem[1]);
					}else{
						copyDic[it]={it:' '};
						this.newData+=' \n';
						console.log(it,' ');
					}
				}
				console.log('维修\n',copyDic);
			}
		}
	}
</script>

<style>
</style>